package com.ecric.http.httppackage;

import android.util.Pair;

import java.util.Map;

/**
 * 自定义网络请求的规范
 * <h3>Description</h3>
 * TODO
 * <h3>Author</h3> luzhenbang
 * <h3>Date</h3> 03/04/2018 18:14
 * <h3>Copyright</h3> Copyright (c)2018 Shenzhen TL  Co., Ltd. Inc. All rights reserved.
 */

public interface IRequest {
    enum HttpMethod {
        GET, POST, PUT, DELETE
    }

    Map<String, String> getParams();

    void setParams(Map<String, String> params);

    void addParams(Map<String, String> params);

    void putParam(String key, String value);

    void putParam(String key, int value);

    String getUrl();

    Pair<Integer, String> doRequest();

    boolean isSupportCache();

    void setMaxRetries(int retry);

    void setCookie(String cookie);

    void removeCookie();

    void addHeader(String key, String value);

    void removeHeader(String key);

    void setContentType(String contentType);

    void setUserAgent(String userAgent);

    String getUserAgent();

    HttpMethod getHttpMethod();

    void setProxy(String host, int port);

}
